<?php namespace Zm345\Com\SDK\OpenLib\Copen\Enterpr\Guestbook;use Zm345\Com\SDK\OpenLib\Copen\AQueryCopen;class GuestbooksDelete extends AQueryCopen{protected$apiParams=[];public function setIds($ids=null){if(!is_array($ids))$ids=explode(',',$ids);$this->apiParams['ids']=$ids;return$this;}public function check(){if(!isset($this->apiParams['ids'])){$this->errorCode='error-param';$this->errorInfo='id必须设置。';return false;}return true;}protected function getQueryStr(){$queryStr='DELETE FROM '.$this->tbPrefix.'enterpr_guestbook';$filterParts=[];$db=$this->db;if(isset($this->apiParams['ids'])){$idParts=array();foreach($this->apiParams['ids']as$id){$idParts[]=$db->quote($id);}if($idParts){$filterParts[]="id IN(".implode(',',$idParts).")";}}if($filterParts){$queryStr.=' WHERE '.implode(' AND ',$filterParts);}$this->apiParams=[];return"$queryStr;";}}?>